﻿namespace class9_数组
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //每一数组的元素都有唯一的索引与之对应，数组的索引从零开始。

            //先声明，再用new进行内存分配

            string[] arr;
            arr = new string[5];

            arr = ["trh", "a4ewrf","reatgedr","eatgdhye5","igvikduj"];


            Console.WriteLine(arr[1]);

            //声明的同时为数组分配内存

            float[] tvv = new float[6];
            tvv = [12.4f, 34.56f, 38.53f, 78.90f, 67.33f];

            Console.WriteLine(tvv[2]);
            
            //数组的初始化，系统会自动分配内存空间

            string[] bhh = new string[] { "distinct",  "conclution", "limbus company", "librabry of rain", "lobotmy cooparation" };


            Console.WriteLine(bhh[3]);

            //数组的使用


            string[] gtt = new string[] { "I", "work", "at" };

            Console.WriteLine(gtt[0]+" " + gtt[1] +" "+ gtt[2]+" " + bhh[2]);





        }
    }
}
